<?php use_helper('jQuery') ?>

        <?php if($f->hasChildren()):?>
		<div id="dir_<?php echo $f->getId() ?>">
		    <div id="open_folder_indicator_<?php echo $f->getId() ?>" style="display: none">
			<?php echo image_tag('/images/indicator.gif') ?>&nbsp;&nbsp;<font color="red"><?php echo __('открываю')?>...</font>
			</div>
			<div id="move_folder_indicator_<?php echo $f->getId() ?>" style="display: none">
			<?php echo image_tag('/images/indicator.gif') ?>&nbsp;&nbsp;<font color="red"><?php echo __('перемещаю')?>...</font>
			</div>
		<?php endif ?>
		
		
		<?php $cur_filter = sfContext::getInstance()->getUser()->getAttribute('material.filters_folder'); ?>
		<?php if (@in_array($f->getId(),$cur_filter)):?>
		<div style="float: left; padding-top:3px"><?php echo image_tag('/images/icons/filter.gif')?></div>
		<?php endif ?>
	
	    <div style="width: 180px; float:left;border:0px solid red; white-space: nowrap; padding-left: <?php echo $f->getLevel()*10?>px;">
	    <?php if($f->hasChildren()):?>
			        <?php if(@in_array($f->getId(),@$rem)):?>
			        <?php 
	                echo jq_link_to_remote(image_tag('/images/icons/folder_open.gif'), array(
				    'update' => 'dir_'.$f->getId(),
	                'script'=>'true',
				    'url'    => 'folder_tools/close_folder?id='.$f->getId(),
				    'loading'  => "$('#close_folder_indicator_".$f->getId()."').show()",
				    'complete' => "$('#close_folder_indicator_".$f->getId()."').hide()"  
				    ),'style="background: none"');
	                ?>	
			        <?php else: ?>
			         <?php 
	                echo jq_link_to_remote(image_tag('/images/icons/folder_close.gif'), array(
				    'update' => 'dir_'.$f->getId(),
	                'script'=>'true',
				    'url'    => 'folder_tools/open_folder?id='.$f->getId(),
				    'loading'  => "$('#open_folder_indicator_".$f->getId()."').show()",
				    'complete' => "$('#open_folder_indicator_".$f->getId()."').hide()"             
				    ),'style="background: none"');
	                ?>		
			        <?php endif ?>
	               	   

               
		<?php else: ?>
		<?php echo image_tag('/images/icons/folder_empty.gif')?>
		<?php endif ?>
		 <?php echo link_to(mb_substr($f,0,20,'utf-8'), $sf_request->getParameter('module') .'/index?folder_id='.$f->getId()) ?>
	    <div style="float: right; margin-top: -18px">
		 <?php include_partial('folder_tools/static_tools',array('f'=>$f));?>
	     </div>
	    </div>
	    <div class="clear"></div>
    
		<?php 
	
        if(@in_array($f->getId(),@$rem))
        {
        	include_component('folder_tools','open_folder',array('id'=>$f->getId(),'rem'=>$rem));
        }
		?>
		
		
		
        <?php if($f->hasChildren()):?>
	    </div>      
		<?php endif ?>		


		
		
		
		
